#
#
#
#

require 'ph/ui/image'

module Ph
  
  class Icon < Ph::Container
    
    def initialize(url, caption, link)
      super()
      
      @body
        .add(@image = Ph::Image.new(url))
        .add(@caption = Ph::Container.new(caption))
        
      self.class_name = 'phtool'
			@image.alt = caption
      
      @link = link
    end
    
    def to_s
      if @link then pHlink(@link, super) else super end
    end
    
  end
end

def phIcon(url, caption, link)
	return Ph::Icon.new(url, caption, link)
end
